<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>员工成绩修改</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">

<script src="js/jquery-2.0.3.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="./css/x-admin.css" media="all">

</head>
<body>
	<div class="x-nav">
		<span class="layui-breadcrumb"> <a><cite>首页</cite></a> <a><cite>员工管理</cite></a>
			<a><cite>员工成绩列表</cite></a>
		</span> <a class="layui-btn layui-btn-small"
			style="line-height: 1.6em; margin-top: 3px; float: right"
			href="javascript:location.replace(location.href);" title="刷新"><i
			class="layui-icon" style="line-height: 30px">ဂ</i></a>
	</div>


	<div class="x-body">
		<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">

			<div class="layui-tab-content">
				<div class="layui-tab-item layui-show">
					<form class="layui-form layui-form-pane"
						action="EmpScoreServlet?op=upd" method="post">

						<input type="hidden" name="scoreNo" id=""
							value="<%=request.getParameter("scoreNo") == null ? "" : request.getParameter("scoreNo")%>" />
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>员工号
							</label>
							<div class="layui-input-block">
								<input type="text" name="empNo" autocomplete="off"
									value="<%=request.getParameter("empNo") == null ? "" : request.getParameter("empNo")%>"
									placeholder="请输入修改后的员工号" class="layui-input"
									lay-verify="required">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>员工姓名
							</label>
							<div class="layui-input-block">
								<input type="text" name="empName" autocomplete="off"
									value="<%=request.getParameter("empName") == null ? "" : request.getParameter("empName")%>"
									class="layui-input" readonly>
							</div>
						</div>
						
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>成绩
							</label>
							<div class="layui-input-block">
								<input type="text" name="score" autocomplete="off"
									value="<%=request.getParameter("score") == null ? "" : request.getParameter("score")%>"
									placeholder="请输入修改后的成绩" class="layui-input"
									lay-verify="required">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">是否通过</label>
							<div class="layui-input-block">
								<input type="radio" id="pass1" name="pass" value="1" title="已通过">
								<div class="layui-unselect layui-form-radio layui-form-radioed">
									<i class="layui-anim layui-icon layui-anim-scaleSpring"></i>
									<div>已通过</div>
								</div>
								<input type="radio" id="pass2" name="pass" value="0" title="未通过">
								<div class="layui-unselect layui-form-radio">
									<i class="layui-anim layui-icon"></i>
									<div>"未通过"</div>
								</div>
							</div>
						</div>
						<div class="layui-form-item layui-form-text">
							<label class="layui-form-label"> <span class='x-red'>*</span>教员评语
							</label>
							<div class="layui-input-block">
								<textarea placeholder="请输入修改后的教员评语" class="layui-textarea"
									lay-verify="required" name="notes"><%=request.getParameter("notes") == null ? "" : request.getParameter("notes")%></textarea>
							</div>
						</div>
						<div class="layui-form-item">
							<button class="layui-btn" type="submit" lay-filter="*"
								lay-submit="submit">保存</button>
						</div>
					</form>
					<div style="height: 100px;"></div>
				</div>

			</div>
		</div>
	</div>
	<script src="./lib/layui/layui.js" charset="utf-8"></script>
	<script src="./js/x-layui.js" charset="utf-8"></script>
	<script>
		var cstate =
	<%=request.getParameter("pass")%>
		if (cstate == 1) {
			$("#pass1").prop("checked", "已通过");
		} else {
			$("#pass2").prop("checked", "未通过");
		}
		layui.use([ 'element', 'layer', 'form' ], function() {
			$ = layui.jquery;//jquery
			lement = layui.element();//面包导航
			layer = layui.layer;//弹出层
			form = layui.form()
			//okLoading.close($);

			//监听提交
			form.on('submit(*)', function(data) {

				var data = data.field;
				$.ajax({
					type : "get",
					url : "EmpScoreServlet?op=upd",
					data : data,
					dataType : "json",
					success : function(data) {
						if (data) {
							layer.msg("修改成功", {
								icon : 1,
								time : 1000
							});
							setTimeout(function() {
								window.parent.location.reload();
								var index = parent.layer
										.getFrameIndex(window.name);
								parent.layer.close(index);
							}, 1000);
							return false;
						} else {
							layer.msg("修改失败", {
								icon : 5,
								time : 2000
							});
							return false;
						}
					}
				});
				return false;
			});
		})
	</script>

</body>
</html>